import { _decorator, Component, Node, Sprite, Vec4 } from 'cc';
const { ccclass, property, executeInEditMode } = _decorator;

@ccclass('OutlineCom')
@executeInEditMode
export class OutlineCom extends Component {
    start() {
        let mat = this.getComponent(Sprite).sharedMaterial;
        let spriteFrame = this.getComponent(Sprite).spriteFrame;
        let size = new Vec4(1.0 / spriteFrame.width, 1.0 / spriteFrame.height, spriteFrame.width, spriteFrame.height);
        mat.setProperty("_TexelSize", size);
    }
}

